﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace peonwar
{
    static class GameTexture
    {
        // ---PROPERTIES---
        // Tableaux pour stocker les textures de chaque peon
        static public Texture2D[] TextureUnitLight1;
        static public Texture2D[] TextureUnitLight2;
        static public Texture2D[] TextureUnitLight3;
        static public Texture2D[] TextureUnitMedium1;
        static public Texture2D[] TextureUnitMedium2;
        static public Texture2D[] TextureUnitMedium3;
        static public Texture2D[] TextureUnitHeavy1;
        static public Texture2D[] TextureUnitHeavy2;
        static public Texture2D[] TextureUnitHeavy3;
        static public Texture2D[] Maps;

        static public Texture2D[] TextureButtonUnit;
        static public Texture2D[] TextureButtonUpgrade;
        static public Texture2D[] TextureEffects;
        static public Texture2D[] TextureBackgrounds;
        static public Texture2D[] CampaignItems;

        // UI
        static public Texture2D Cursor;
        static public Texture2D Cursor2;
        static public Texture2D Console;
        static public Texture2D Chat_;
        static public Texture2D PrepareBackground;
        static public Texture2D PrepareBackground2;

        // HUD
        static public Texture2D[] TextureMinimap;
        static public Texture2D[] Researchs;
        static public Texture2D ResearchWindow;
        static public Texture2D ResearchButton;
        static public Texture2D CancelResearchButton;
        static public Texture2D Cooldown;
        static public Texture2D Cooldownbar;
        static public Texture2D BaseHealth;
        static public Texture2D BaseHealthEnemy;
        static public Texture2D Experience;
        static public Texture2D BaseHealthBar;
        static public Texture2D BaseHealthBarEnemy;
        static public Texture2D ExperienceBar;
        static public Texture2D Bankbar;
        static public Texture2D Backhud;
        static public Texture2D UnitHealth;
        static public Texture2D UnitHealthBar;
        static public Texture2D Layer;
        static public Texture2D LayerSelect;
        static public Texture2D Base_Upgrade_Health;
        static public Texture2D Base_Upgrade_Cost;
        static public Texture2D Base_Upgrade_Income;
        static public Texture2D EmptyButton;
        static public Texture2D HealButton;
        static public Texture2D GoldButton;
        static public Texture2D EnergyButton;
        static public Texture2D BombButton;
        static public Texture2D RandButton;
        static public Texture2D SuperButton;
        static public Texture2D KillButton;
        static public Texture2D BankTimer;
        static public Texture2D GameTimer;
        static public Texture2D Infini;
        static public Texture2D Link;
        static public Texture2D UILockPower;
        static public Texture2D Slender;


        //Menu
        static public Texture2D ButtonPlay;
        static public Texture2D ButtonExit;
        static public Texture2D PauseBackground;
        static public Texture2D PauseResume;
        static public Texture2D PauseGoMenu;
        static public Texture2D MenuReturn;
        static public Texture2D GameOverBackground;
        static public Texture2D [] TextureGradeIa;
        static public Texture2D ProfilBackground;
        static public Texture2D AddProfilBackground;
        static public Texture2D ProfilArrow;
        static public Texture2D [] PersoAvatar;
        static public Texture2D CadrePerso;
        static public Texture2D Lobbybackground;
        static public Texture2D LobbyStart;
        static public Texture2D LobbyReady;
        static public Texture2D LobbyReadyLong;
        static public Texture2D LobbyPasReady;
        static public Texture2D WaitingCircle;

        //Achievment

        static public Texture2D Achievement;
        static public Texture2D Achievement_half;
        static public Texture2D Ascenseur;
        static public Texture2D conteneur;
        static public Texture2D Ach_cadre;
        static public Texture2D Ach_cadreun;

        // Autre
        static public Texture2D Base;
        static public Texture2D Basedoor;
        static public Texture2D Bombes;



        // ---METHODES---
        static public void LoadContent(ContentManager content)
        {
            // Chargement des textures
            // Tableaux de texture des peons
            // 0: Idle 
            // 1: Walk 
            // 2: DrawIn 
            // 3: Fire
            // 4: DrawOut
            // 5: Die (+6 , +7 jusqu'a autant de mort qu'on veut)

            TextureUnitLight1 = new Texture2D[] {
                content.Load<Texture2D>("Unit/UnitLight1/UnitLight1_Idle"),
                content.Load<Texture2D>("Unit/UnitLight1/UnitLight1_Walk"),
                content.Load<Texture2D>("Unit/UnitLight1/UnitLight1_DrawIn"),
                content.Load<Texture2D>("Unit/UnitLight1/UnitLight1_Fire"),
                content.Load<Texture2D>("Unit/UnitLight1/UnitLight1_DrawOut"),
                content.Load<Texture2D>("Unit/UnitLight1/UnitLight1_Die")};

            TextureUnitLight2 = new Texture2D[] {
                content.Load<Texture2D>("Unit/UnitLight2/UnitLight2_Idle"),
                content.Load<Texture2D>("Unit/UnitLight2/UnitLight2_Walk"),
                content.Load<Texture2D>("Unit/UnitLight2/UnitLight2_DrawIn"),
                content.Load<Texture2D>("Unit/UnitLight2/UnitLight2_Fire"),
                content.Load<Texture2D>("Unit/UnitLight2/UnitLight2_DrawOut"),
                content.Load<Texture2D>("Unit/UnitLight2/UnitLight2_Die")};

            TextureUnitLight3 = new Texture2D[] {
                content.Load<Texture2D>("Unit/UnitLight3/UnitLight3_Idle"),
                content.Load<Texture2D>("Unit/UnitLight3/UnitLight3_Walk"),
                content.Load<Texture2D>("Unit/UnitLight3/UnitLight3_DrawIn"),
                content.Load<Texture2D>("Unit/UnitLight3/UnitLight3_Fire"),
                content.Load<Texture2D>("Unit/UnitLight3/UnitLight3_DrawOut"),
                content.Load<Texture2D>("Unit/UnitLight3/UnitLight3_Die"),
                content.Load<Texture2D>("Unit/UnitLight3/UnitLight3_Die2"),
                content.Load<Texture2D>("Unit/UnitLight3/UnitLight3_Die3")};

            TextureUnitMedium1 = new Texture2D[] {
                content.Load<Texture2D>("Unit/UnitMedium1/UnitMedium1_Idle"),
                content.Load<Texture2D>("Unit/UnitMedium1/UnitMedium1_Walk"),
                content.Load<Texture2D>("Unit/UnitMedium1/UnitMedium1_DrawIn"),
                content.Load<Texture2D>("Unit/UnitMedium1/UnitMedium1_Fire"),
                content.Load<Texture2D>("Unit/UnitMedium1/UnitMedium1_DrawOut"),
                content.Load<Texture2D>("Unit/UnitMedium1/UnitMedium1_Die"),
                };

            TextureUnitMedium2 = new Texture2D[] {
                content.Load<Texture2D>("Unit/UnitMedium2/UnitMedium2_Idle"),
                content.Load<Texture2D>("Unit/UnitMedium2/UnitMedium2_Walk"),
                content.Load<Texture2D>("Unit/UnitMedium2/UnitMedium2_DrawIn"),
                content.Load<Texture2D>("Unit/UnitMedium2/UnitMedium2_Fire"),
                content.Load<Texture2D>("Unit/UnitMedium2/UnitMedium2_DrawOut"),
                content.Load<Texture2D>("Unit/UnitMedium2/UnitMedium2_Die"),
                };

            TextureUnitMedium3 = new Texture2D[] {
                content.Load<Texture2D>("Unit/UnitMedium3/UnitMedium3_Idle"),
                content.Load<Texture2D>("Unit/UnitMedium3/UnitMedium3_Walk"),
                content.Load<Texture2D>("Unit/UnitMedium3/UnitMedium3_DrawIn"),
                content.Load<Texture2D>("Unit/UnitMedium3/UnitMedium3_Fire"),
                content.Load<Texture2D>("Unit/UnitMedium3/UnitMedium3_DrawOut"),
                content.Load<Texture2D>("Unit/UnitMedium3/UnitMedium3_Die"),
                };

            TextureUnitHeavy1 = new Texture2D[] {
                content.Load<Texture2D>("Unit/UnitHeavy1/UnitHeavy1_Idle"),
                content.Load<Texture2D>("Unit/UnitHeavy1/UnitHeavy1_Walk"),
                content.Load<Texture2D>("Unit/UnitHeavy1/UnitHeavy1_DrawIn"),
                content.Load<Texture2D>("Unit/UnitHeavy1/UnitHeavy1_Fire"),
                content.Load<Texture2D>("Unit/UnitHeavy1/UnitHeavy1_DrawOut"),
                content.Load<Texture2D>("Unit/UnitHeavy1/UnitHeavy1_Die"),
                };

            TextureUnitHeavy2 = new Texture2D[] {
                content.Load<Texture2D>("Unit/UnitHeavy2/UnitHeavy2_Idle"),
                content.Load<Texture2D>("Unit/UnitHeavy2/UnitHeavy2_Walk"),
                content.Load<Texture2D>("Unit/UnitHeavy2/UnitHeavy2_DrawIn"),
                content.Load<Texture2D>("Unit/UnitHeavy2/UnitHeavy2_Fire"),
                content.Load<Texture2D>("Unit/UnitHeavy2/UnitHeavy2_DrawOut"),
                content.Load<Texture2D>("Unit/UnitHeavy2/UnitHeavy2_Die"),
                };

            TextureUnitHeavy3 = new Texture2D[] {
                content.Load<Texture2D>("Unit/UnitHeavy3/UnitHeavy3_Idle"),
                content.Load<Texture2D>("Unit/UnitHeavy3/UnitHeavy3_Walk"),
                content.Load<Texture2D>("Unit/UnitHeavy3/UnitHeavy3_DrawIn"),
                content.Load<Texture2D>("Unit/UnitHeavy3/UnitHeavy3_Fire"),
                content.Load<Texture2D>("Unit/UnitHeavy3/UnitHeavy3_DrawOut"),
                content.Load<Texture2D>("Unit/UnitHeavy3/UnitHeavy3_Die"),
                };

            TextureButtonUnit = new Texture2D[] {
                content.Load<Texture2D>("Unit/LockButton"),
                content.Load<Texture2D>("Unit/UnitLight1/Button_UnitLight1"),
                content.Load<Texture2D>("Unit/UnitLight2/Button_UnitLight2"),
                content.Load<Texture2D>("Unit/UnitLight3/Button_UnitLight3"),
                content.Load<Texture2D>("Unit/UnitMedium1/Button_UnitMedium1"),
                content.Load<Texture2D>("Unit/UnitMedium2/Button_UnitMedium2"),
                content.Load<Texture2D>("Unit/UnitMedium3/Button_UnitMedium3"),
                content.Load<Texture2D>("Unit/UnitHeavy1/Button_UnitHeavy1"),
                content.Load<Texture2D>("Unit/UnitHeavy2/Button_UnitHeavy2"),
                content.Load<Texture2D>("Unit/UnitHeavy3/Button_UnitHeavy3"),
                content.Load<Texture2D>("Unit/UnavailableButton")};

            TextureButtonUpgrade = new Texture2D[] {
                content.Load<Texture2D>("HUD/UpGrades/UpGrade_lv1"),
                content.Load<Texture2D>("HUD/UpGrades/UpGrade_lv2"),
                content.Load<Texture2D>("HUD/UpGrades/UpGrade_lv3"),
                content.Load<Texture2D>("HUD/UpGrades/UpGrade_lv4"),
                content.Load<Texture2D>("HUD/UpGrades/Button_UpGrade")};

            TextureEffects = new Texture2D[] {
                content.Load<Texture2D>("Effects/Effect_Sniper"),
                content.Load<Texture2D>("Effects/Effect_Explosion1"),
                content.Load<Texture2D>("Effects/Effect_Explosion2")};

            CampaignItems = new Texture2D[] {
                content.Load<Texture2D>("UI/Node_Locked"),
                content.Load<Texture2D>("UI/Node_Unlocked"),
                content.Load<Texture2D>("UI/SelectNode")};

            Maps = new Texture2D[] {
                content.Load<Texture2D>("Environment/Background_Forest"),
                content.Load<Texture2D>("Environment/Background_Grass"),
                content.Load<Texture2D>("Environment/Background_Desert"),
                content.Load<Texture2D>("Environment/Background_Winter"),
                content.Load<Texture2D>("Environment/Background_Temple"),
                content.Load<Texture2D>("Environment/Background_BorderLand"),
                content.Load<Texture2D>("Environment/Background_City"),};


            TextureBackgrounds = new Texture2D[] {
                 content.Load<Texture2D>("Menu/Background_Achievement"),
                 content.Load<Texture2D>("Menu/IpDot"),
                 content.Load<Texture2D>("Menu/Background_Menu"),
                 content.Load<Texture2D>("Menu/Background_Option"),
                 content.Load<Texture2D>("Menu/Background_Campaign"),
                 content.Load<Texture2D>("Menu/Background_AchievementTop")};

            TextureMinimap = new Texture2D[] {
                content.Load<Texture2D>("HUD/Minimap/Minimap_UnitLight"),
                content.Load<Texture2D>("HUD/Minimap/Minimap_UnitMedium"),
                content.Load<Texture2D>("HUD/Minimap/Minimap_UnitHeavy"),
                content.Load<Texture2D>("HUD/Minimap/Minimap_Warning"),
                content.Load<Texture2D>("HUD/Minimap/Minimap_Square"),
                content.Load<Texture2D>("HUD/Minimap/Minimap")};

            // UI
            Cursor = content.Load<Texture2D>("UI/Cursor");
            Cursor2 = content.Load<Texture2D>("UI/Cursor2");
            Console = content.Load<Texture2D>("UI/Console");
            Chat_ = content.Load<Texture2D>("UI/chat");
            PrepareBackground = content.Load<Texture2D>("UI/Prepare");
            PrepareBackground2 = content.Load<Texture2D>("UI/Prepare2");

            // HUD
            Cooldown = content.Load<Texture2D>("HUD/Cooldown");
            Cooldownbar = content.Load<Texture2D>("HUD/Cooldownbar");
            BaseHealth = content.Load<Texture2D>("HUD/BaseHealth");
            Experience = content.Load<Texture2D>("HUD/Experience");
            BaseHealthEnemy = content.Load<Texture2D>("HUD/BaseHealthEnemy");
            BaseHealthBar = content.Load<Texture2D>("HUD/BaseHealthBar");
            BaseHealthBarEnemy = content.Load<Texture2D>("HUD/BaseHealthBarEnemy");
            ExperienceBar = content.Load<Texture2D>("HUD/ExperienceBar");
            Bankbar = content.Load<Texture2D>("HUD/Bankbar");
            Backhud = content.Load<Texture2D>("HUD/BackHud");
            UnitHealth = content.Load<Texture2D>("HUD/UnitHealth");
            UnitHealthBar = content.Load<Texture2D>("HUD/UnitHealthBar");
            Layer = content.Load<Texture2D>("HUD/Layer");
            LayerSelect = content.Load<Texture2D>("HUD/LayerSelect");
            KillButton = content.Load<Texture2D>("HUD/KillButton");
            BankTimer = content.Load<Texture2D>("HUD/Timer_bank");
            GameTimer = content.Load<Texture2D>("HUD/GameTimer");
            Infini = content.Load<Texture2D>("HUD/inifini");
            Slender = content.Load<Texture2D>("HUD/slender");

                // Pouvoirs buttons
            EmptyButton = content.Load<Texture2D>("HUD/Pouvoirs/PvrEmptyButton");
            HealButton = content.Load<Texture2D>("HUD/Pouvoirs/PvrHealButton");
            GoldButton = content.Load<Texture2D>("HUD/Pouvoirs/PvrGoldButton");
            EnergyButton = content.Load<Texture2D>("HUD/Pouvoirs/PvrEnergyButton");
            BombButton = content.Load<Texture2D>("HUD/Pouvoirs/PvrBombButton");
            SuperButton = content.Load<Texture2D>("HUD/Pouvoirs/PvrSuperButton");
            RandButton = content.Load<Texture2D>("HUD/Pouvoirs/PvrRandButton");
            UILockPower = content.Load<Texture2D>("UI/LockPower");

            //Menu
            ButtonExit = content.Load<Texture2D>("Menu/Exit");
            ButtonPlay = content.Load<Texture2D>("Menu/Play");
            PauseBackground = content.Load<Texture2D>("Menu/PauseMenu");
            PauseGoMenu = content.Load<Texture2D>("Menu/GoToMenu");
            PauseResume = content.Load<Texture2D>("Menu/ResumeGame");
            MenuReturn = content.Load<Texture2D>("Menu/Fleche_retour");
            GameOverBackground = content.Load<Texture2D>("Menu/GameOverBackground");
            Base_Upgrade_Cost = content.Load<Texture2D>("HUD/UpGrades/Base_Upgrade_Cost");
            Base_Upgrade_Health = content.Load<Texture2D>("HUD/UpGrades/Base_Upgrade_Health");
            Base_Upgrade_Income = content.Load<Texture2D>("HUD/UpGrades/Base_Upgrade_Income");
            ProfilBackground = content.Load<Texture2D>("Menu/Background_Profil");
            AddProfilBackground = content.Load<Texture2D>("Menu/Background_Profil_Add");
            ProfilArrow = content.Load<Texture2D>("Menu/Fleche_profil");
            Lobbybackground = content.Load<Texture2D>("Menu/lobby_background");
            LobbyStart = content.Load<Texture2D>("Menu/StartLobby");
            LobbyReady = content.Load<Texture2D>("Menu/Coche_ready");
            LobbyPasReady = content.Load<Texture2D>("Menu/Coche_notready");
            LobbyReadyLong = content.Load<Texture2D>("Menu/lobby_ready_long");
            PersoAvatar = new Texture2D[] {
                content.Load<Texture2D>("Menu/Perso/Perso7"),
                content.Load<Texture2D>("Menu/Perso/Perso1"),
                content.Load<Texture2D>("Menu/Perso/Perso5"),
                content.Load<Texture2D>("Menu/Perso/Perso2"),
                content.Load<Texture2D>("Menu/Perso/Perso4"),
                content.Load<Texture2D>("Menu/Perso/Perso6"),
                content.Load<Texture2D>("Menu/Perso/Perso3")};

            CadrePerso = content.Load<Texture2D>("Profils/Cadre");

            // IA GRADES
            TextureGradeIa = new Texture2D[] {
                content.Load<Texture2D>("Menu/GradesIA/Training"),
                content.Load<Texture2D>("Menu/GradesIA/Easy"),
                content.Load<Texture2D>("Menu/GradesIA/Medium"),
                content.Load<Texture2D>("Menu/GradesIA/Hard"),
                content.Load<Texture2D>("Menu/GradesIA/Empowered"),
                content.Load<Texture2D>("Menu/GradesIA/Hopeless")};

            //Recherches
            Researchs = new Texture2D[15];
            for (int i = 1; i <= Researchs.GetLength(0); i++)
                Researchs[i-1] = content.Load<Texture2D>("Research/Rsrch" + i);

            ResearchWindow = content.Load<Texture2D>("Research/ResearchWin");
            ResearchButton = content.Load<Texture2D>("Research/ResearchButton");
            Link = content.Load<Texture2D>("Research/Link");
            CancelResearchButton = content.Load<Texture2D>("Research/CancelButton");


            //Achiecvemetn
            Achievement = content.Load<Texture2D>("Achievement/Achievement");
            Achievement_half = content.Load<Texture2D>("Achievement/HalfAchieved");
            Ascenseur = content.Load<Texture2D>("Achievement/Ascenseur");
            conteneur = content.Load<Texture2D>("Achievement/ascenseurlong");
            Ach_cadre = content.Load<Texture2D>("Achievement/achievementcadre");
            Ach_cadreun = content.Load<Texture2D>("Achievement/achievementcadreun");

            // Autre
            Base = content.Load<Texture2D>("Environment/Base");
            Basedoor = content.Load<Texture2D>("Environment/Basedoor");
            Bombes = content.Load<Texture2D>("Effects/bombes");
            WaitingCircle = content.Load<Texture2D>("UI/WaitingCircleEnhanced2");
        }
    }
}
